package com.probiz.estore.exports.handler.salesOrder;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;

import com.probiz.estore.common.model.order.SalesOrder;
import com.probiz.estore.exports.handler.ColumnHandler;
import com.probiz.estore.exports.model.Column;

public class OrderAddressHandler implements ColumnHandler  {

	public String getProperty(Object target, Column column, HSSFSheet sheet,
			HSSFRow row, List<String> listHeader) {
		SalesOrder order = (SalesOrder) target;
		if(order != null && order.getOrderAddress() != null){
			
			return (order.getOrderAddress().getRegionFullName() == null ? "" : (order.getOrderAddress().getRegionFullName()+" "))+
				   (order.getOrderAddress().getAddress1()== null ? "" : (order.getOrderAddress().getAddress1()+" "))+
				   (order.getOrderAddress().getAddress2() == null ? "" : order.getOrderAddress().getAddress2());
		}
		return null;
	}

}
